{% extends 'home/home.html' %}
{% block index %}
{% load static %}



<div class="uk-section uk-section-small  uk-text-center">
    <div class="uk-width-1-1">
        <div class="uk-container" style="max-width: 1200px;">
            <h2 class="uk-h2">
                个人资料
            </h2>
            <hr
                style="height: 2px;padding: 0;border: none;text-align: center;background-image: linear-gradient(to right, rgba(60, 122, 198, 0), rgba(6, 58, 122, 1), rgba(60, 122, 198, 0));" />
            <p><img src="{{ myuser.avatar }}" style="max-width: 200px;border-radius: 10%;"></p>
            <p class="uk-text-lead">{{ myuser.user }}</p>
            <p class="uk-text-center">{{ myuser.real_name }}</p>
            <table class="uk-table uk-table-striped uk-table-hover uk-table-small">
                <tbody>
                    <tr>
                        <td style="font-weight:bold;">年龄</td>
                        <td class="uk-text-right">
                            {{ myuser.age }}岁
                        </td>
                    </tr>
                    <tr>
                        <td style="font-weight:bold;">性别</td>
                        <td class="uk-text-right">
                            {% if myuser.gender == "male" %}
                            男
                            {% elif myuser.gender == "female" %}
                            女
                            {% else %}
                            保密
                            {% endif %}
                        </td>
                    </tr>
                    <tr>
                        <td style="font-weight:bold;">加入时间</td>
                        <td class="uk-text-right">
                            {{ myuser.user.date_joined }}
                        </td>
                    </tr>
                    <tr>
                        <td style="font-weight:bold;">上次登录</td>
                        <td class="uk-text-right">
                            {{ myuser.user.last_login }}
                        </td>
                    </tr>
                    <tr>
                        <td style="font-weight:bold;">个性简介</td>
                        <td class="uk-text-right">
                            {% if superuser %}
                            {% autoescape off %}
                            {{ myuser.signature }}
                            {% endautoescape %}
                            {% else %}
                            {{ myuser.signature }}
                            {% endif %}
                        </td>
                    </tr>
                </tbody>
            </table>



            {% if notices %}
            <h2 class="uk-h2">
                课程预告
            </h2>
            <hr
                style="height: 2px;padding: 0;border: none;text-align: center;background-image: linear-gradient(to right, rgba(60, 122, 198, 0), rgba(6, 58, 122, 1), rgba(60, 122, 198, 0));" />
            <table class="uk-table uk-table-striped uk-table-hover uk-table-small uk-table-middle">
                <thead>
                    <tr class="uk-text-lead " style="font-weight:bold;">
                        <th style="font-size: 1em;font-weight:bold; min-width: 100px;">序号</th>
                        <th style="font-size:  1em;font-weight:bold; min-width: 200px;">课程名称</th>
                        <th class="uk-text-center" style="font-size: 1em;font-weight:bold; min-width: 100px;">
                            上课时间</th>
                        <th class="uk-text-center" style="font-size: 1em;font-weight:bold; min-width: 100px;">
                            课程时长</th>
                        <th class="uk-text-right" style="font-size: 1em;font-weight:bold;min-width: 100px;">
                            教师</th>
                    </tr>
                </thead>
                <tbody>
                    {% for lesson in notices %}
                    <tr>
                        <td style="font-weight:bold;">{{ lesson.new_id }}</td>
                        <td>
                            <a href="/service/notice/{{ lesson.id }}" target="_blank">
                                <dt class="uk-text-normal uk-text-primary">
                                    {{ lesson.title }}
                                </dt>
                            </a>
                        </td>
                        <td class="uk-text-center" style="font-size:0.75em;">{{ lesson.start }}</td>
                        <td class="uk-text-center" style="font-size:0.75em;">{{ lesson.lesson_type.duration }}分钟</td>
                        <td class="uk-text-right uk-text-emphasis" style="font-size:0.75em;">{{ lesson.teacher }}</td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
            {% endif %}





            {% if notes %}
            <h2 class="uk-h2">
                最近上课记录
            </h2>
            <hr
                style="height: 2px;padding: 0;border: none;text-align: center;background-image: linear-gradient(to right, rgba(60, 122, 198, 0), rgba(6, 58, 122, 1), rgba(60, 122, 198, 0));" />
            <table class="uk-table uk-table-striped uk-table-hover uk-table-large"
                style="vertical-align: center;">
                <thead>
                    <tr class="uk-text-lead " style="font-weight:bold;">
                        <th style="font-size: 1em;font-weight:bold; min-width: 50px;">序号</th>
                        <th style="font-size:  1em;font-weight:bold; min-width: 100px;">课程名称</th>
                        <th class="uk-text-center" style="font-size: 1em;font-weight:bold; min-width: 150px;">
                            上课时间</th>
                        <th class="uk-text-center" style="font-size: 1em;font-weight:bold; min-width: 150px;">
                            下课时间</th>
                        <th class="uk-text-center" style="font-size: 1em;font-weight:bold;min-width: 50px;">
                            学员</th>
                        <th class="uk-text-right" style="font-size: 1em;font-weight:bold;min-width: 50px;">
                            教师</th>
                    </tr>
                </thead>
                <tbody>
                    {% for lesson in notes %}
                    <tr>
                        <td style="font-weight:bold;vertical-align: middle;">{{ lesson.new_id }}</td>
                        <td style="vertical-align: middle;">
                            <a href="/service/lesson_note/{{ lesson.id }}" target="_blank">
                                <dt class="uk-text-normal uk-text-primary">
                                    {{ lesson.title }}
                                </dt>
                            </a>
                        </td>
                        <td class="uk-text-center" style="font-size:0.75em;vertical-align: middle;">{{ lesson.start }}</td>
                        <td class="uk-text-center" style="font-size:0.75em;vertical-align: middle;">{{ lesson.end }}</td>
                        <td class="uk-text-center" style="font-size:0.75em;vertical-align: middle;">{% autoescape off %}{{ lesson.stu_names }}
                            {% endautoescape %}</td>
                        <td class="uk-text-right uk-text-emphasis" style="font-size:0.75em;vertical-align: middle;">{{ lesson.teacher }}</td>
                        </td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
            {% endif %}
        </div>
    </div>
</div>
{% endblock %}